<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ attribute name="pm" type="com.cb.model.product.Param" required="true" description="The Param object" %>
<%@ attribute name="pv" type="com.cb.model.product.ParamValue" description="The Param init values" %>
<c:set var="_attr">required="${pm.isRequired}" label="${pm.paramName}" validExpression="${pm.validExpression}" paramId=${pm.paramId}</c:set>
<c:if test="${not empty pv}">
	<c:set var="curValue" value="${pv.paramValue}"/>
</c:if>
<input type="hidden" name="_paramValueId${pm.paramId}" value="${pv.valueId}"/>
<c:choose>
	<c:when test="${pm.inputType==4 || pm.inputType==5 }">
		<select name="_paramName${pm.paramId}"  <c:if test="${pm.inputType==5}">multiple</c:if> ${_attr}>
			<option value=""></option>
			<c:forEach items="${pm.paramOptions}" var="option">
				<option value="${option.optionValue}" <c:if test="${curValue==option.optionValue}">selected</c:if>>${option.optionName}</option>
			</c:forEach>
		</select>
	</c:when>
	<c:otherwise>
		<c:choose>
			<c:when test="${pm.maxlength>48}">
				<textarea name="_paramName${pm.paramId}" rows="4" cols="40" ${_attr}>${curValue}</textarea>
			</c:when>
			<c:otherwise>
				<input type="text" name="_paramName${pm.paramId}" ${_attr} value="${curValue}"/>
			</c:otherwise>
		</c:choose>
	</c:otherwise>
</c:choose><c:if test="${not pm.unit}">&nbsp;${pm.unit}</c:if>
<span id="_span${pm.paramId}" class="spanFieldTips">${pm.paramDesc}</span>